<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script>
    function outer(){
        var x = 0;
        function private1(){
            return x++;
        }
        function private2(){
            return x--;
        }
        return {a:private1, b:private2};
    }
    
    var obj = outer();
    console.log(obj["a"]()+", "+obj["b"]());
</script>
</head>
<body>

</body>
</html>